package com.xywl;
/*class Point{
    private int x;
    private static int v;//加static的函数实例化的对象可以共用
    public int f(){
        return 0;
    }
    public static int g(){
        return 0;
    }
}*/
import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.Callable;
/*class Argment{
    public final static int x=1;//全局的静态变量
    public final static int y=1;
}*/

//public class Main {
    //public static void main(String[] args) {
        /*Scanner sc=new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt();
        System.out.println(max(a,b));*/
        /*int[][] a=new int[3][4];
        fill(a,3);
        System.out.println(Arrays.deepToString(a));*/
        /*int[][] a=getArray2d(3,4,10);
        System.out.println(Arrays.deepToString(a));*/
        //System.out.println(Argment.x);
   // }
    /*private static int max(int a,int b){
        return Math.max(a,b);

    }
    private static void fill(int[][] a,int val){
        for(int i=0;i<a.length;i++)
            for(int j=0;j<a[i].length;j++)
                a[i][j]=val;
    }
    private static int[][] getArray2d(int row,int col,int val)
    {
        int[][] ans=new int[row][col];
        for(int i=0;i<row;i++)
            for(int j=0;j<col;j++)
                ans[i][j]=val;
        return ans;
    }*/

//}
/*class Node{
    public void f(){
        System.out.println("f");
    }
    public static void g(){
        System.out.println("g");
    }


}
public class Main {
    public static void main(String[] args) {
        Node node=new Node();
        node.f();//实例调用
        Node.g();//static绑定在类上，类的调用，反过来不行

    }
}*/
/*public class Main {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int row=sc.nextInt(),col=sc.nextInt();
        int[][] w=new int[row][col];
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j++) {
                w[i][j]=sc.nextInt();
            }
        }
        print2D(w,row,col);
    }
    private static void print2D(int[][] w,int row,int col)
    {
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j++) {
                System.out.printf("%d ",w[i][j]);
            }
            System.out.println();
        }
    }
}*/
//int[] a=new int[10],b=new int[20];
class Point{
    private int x;
    private int y;
    public Point(int x,int y)//构造函数
    {
        this.x=x;
        this.y=y;
    }
    public int getX(){
        return x;
    }
    public int getY(){
        return y;
    }
    public void setX(int x){
        this.x=x;
    }
    public void setY(int y)
    {
        this.y=y;
    }
    public String toString(){
        return String.format("(%d,%d)",x,y);
    }
}
//继承：一个带颜色的点
class ColorPoint extends Point{
    private String color;
    public ColorPoint(int x,int y,String color)
    {
        super(x,y);//调用副类的构造函数
        this.color=color;
    }
    public String getColor(){
        return color;
    }
    public void setColor(String color){
        this.color=color;
    }
    public String toString(){
        return String.format("(%d,%d,%s)",super.getX(),super.getY(),color);
    }
}
/*
public class Main {
    public static void main(String[] args) {
        Point point =new Point(3,4);
        point.setX(5);
        point.setY(10);
        System.out.println(point.toString());
    }
}*/
public class Main {
    public static void main(String[] args) {
       ColorPoint colorPoint=new ColorPoint(3,4,"red");
        System.out.println(colorPoint.toString());
        System.out.println(colorPoint.getX());
    }
}